package com.example.lms.controller;

import com.example.lms.entity.ShipmentRecords;
import com.example.lms.service.ShipmentRecordsService;
import com.example.lms.vo.D;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @module
 * @author：DUOLUONIANDAI
 * @DATA：2024/05/13
 * @Title：映射请求
 */

@RestController
public class ShipmentRecordsController {

    @Resource
    ShipmentRecordsService shipmentRecordsService;

    /**
     * @param
     * @return
     * @Title Api fox-api
     * @api.name 根据id查询一个用户的一个物品、仓库、个人信息
     * @folder 映射请求
     */

    @GetMapping("/getSR")
    public D getSR(@RequestParam("id") String id){
        return shipmentRecordsService.querySROne(id);
    }

    /**
     * @param
     * @return
     * @Title Api fox-api
     * @api.name 根据id删除一个仓库映射信息
     * @folder 映射请求
     */

    @PutMapping("delSR")
    public D delSR(@RequestParam("id") String id){
        return shipmentRecordsService.delSR(id);
    }

    /**
     * @param
     * @return
     * @Title Api fox-api
     * @api.name 添加映射信息
     * @folder 映射请求
     */

    @PostMapping("addSR")
    public D addSR(@RequestBody ShipmentRecords shipmentRecords){
        return shipmentRecordsService.addSR(shipmentRecords);
    }
}
